#!/bin/bash

tag_name=$1

cd src/realtime-rms
git fetch
git checkout ${tag_name}
git pull

cd -
current_time=`date "+%Y-%m-%d:%H:%M:%S"`
echo "${current_time} realtime-rms updated" >> conf/RELEASE_NOTE
git commit conf/RELEASE_NOTE -m "update realtime-rms on ${current_time}"
./Build -v 6 -n ${tag_name}
git rev-list HEAD | wc -l > last_version
./postbuild ${tag_name}
git checkout master
